# -*- coding: utf-8 -*-  

import MySQLdb

f=open("tmp")
lines=f.readlines()
stocks=list()
for i in lines:
  seq=i.strip().split()
  stocks.append(seq[0][2:])
conn=MySQLdb.connect(host="10.241.84.65",user="root",db="stock")
cursor = conn.cursor()
sql="delete from stock_class where class='buypoint'"
cursor.execute(sql)

for i in stocks:
  sql = "insert into stock_class values('%s','%s','%s')" % ("buypoint", "buypoint", i);
  try:
    cursor.execute(sql)
  except:
    pass
  #img="http://img.finance.ifeng.com/chart/big/kline/%s.gif"%(realCode(i[0]))
  #os.system("cd ../img&&wget -q %s -O %s.gif" % (img, i[0]))

